# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=carwhisperer
pkgver=0.2
pkgrel=8
pkgdesc='Intends to sensibilise manufacturers of carkits and other Bluetooth appliances without display and keyboard for the possible security threat evolving from the use of standard passkeys.'
url='http://trifinite.org/trifinite_stuff_carwhisperer.html'
groups=('blackarch' 'blackarch-bluetooth')
license=('GPL')
depends=('bluez-libs' 'perl')
arch=('x86_64' 'aarch64')
source=("http://trifinite.org/Downloads/$pkgname-$pkgver.tar.gz")
sha512sums=('bf322bde831ae7eaceba4d2dd3d34768218c5db693f8eda28af0a1cc0fb889f4e66f1c8baadd39f2203b61b478e4ae73e4dd2b59be878410b2badf23e2eb80e1')

build() {
  cd "$pkgname-$pkgver"

  make
}

package(){
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname/samples"
  install -dm 755 "$pkgdir/usr/share/$pkgname/scripts"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -m 644 -t "$pkgdir/usr/share/doc/$pkgname"
  install -m 644 hcid.conf "$pkgdir/usr/share/$pkgname"
  install -m 644 *.raw "$pkgdir/usr/share/$pkgname/samples"
  install -Dm 755 cw_pin.pl cw_scanner "$pkgdir/usr/share/$pkgname/scripts"
}

